package com.android.huimeiqupin.adapt;

import android.widget.ImageView;

import com.android.huimeiqupin.model.group.SortBrandData;
import com.android.huimeiqupin.utils.ObjectUtils;
import com.android.huimeiqupin.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2016/8/10.
 */
public class MainListSortBrandAdapt extends BaseQuickAdapter<SortBrandData.DataBean.ListBean, BaseViewHolder> {


    public MainListSortBrandAdapt(int layoutResId, List<SortBrandData.DataBean.ListBean> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder holder, SortBrandData.DataBean.ListBean listBean) {
        holder.setVisible(R.id.ll_dapai, true);

        holder.setText(R.id.item_list_sort_dapai_img_name, listBean.getCatname());
        holder.setText(R.id.item_list_sort_dapai_img_time, "还剩" + listBean.getEnd_day() + "天");
        holder.setText(R.id.item_list_sort_dapai_img_count, listBean.getSale() + "折起");

        ObjectUtils.photo2(mContext, listBean.getThumb(), (ImageView) holder.getView(R.id.item_list_sort_dapai_img));
    }


}
